package com.dragon.repository.domain.dto;

import com.dragon.repository.entity.ContractArticleSon;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.dragon.common.util.BeanUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Date;


/**
 * @author sy
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ContractArticleSonDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private Integer id;

    @ApiModelProperty(value = "合同id")
    private Integer contractId;

    @ApiModelProperty(value = "条款id")
    private Integer articleId;


    public ContractArticleSonDTO() {}

    public ContractArticleSonDTO(ContractArticleSon entity) {
        BeanUtils.copyProperties(entity,this);
    }

    public static ContractArticleSonDTO convert(ContractArticleSon entity) {
        return new ContractArticleSonDTO(entity);
    }

    public static List<ContractArticleSonDTO> convertList(List<ContractArticleSon> list) {
        List<ContractArticleSonDTO> resultList = new ArrayList<>();
        for (ContractArticleSon entity : list) {
            resultList.add(new ContractArticleSonDTO(entity));
        }
        return resultList;
    }}
